package testWork;

import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int [] val = new int[n-1];
        for (int i = 0; i < n; i++) {
            int temp = scanner.nextInt();
            if(i!=m){
                val[i] = temp;
            }
            System.out.print(val[i]+" ");
        }
    }
}
